package com.interview.ujiuye1;


/**
 * Copyright (C), 2018-2020
 * FileName: Demo1
 * Author:   kongfanyu
 * Date:     2020/9/14 09:21
 */

public class Demo1 {

    public static void main(String[] args) {
        Integer f1 = 100, f2 = 100, f3 = 150, f4 = 150;
        System.out.println(f1 == f2);//== 比较的引用地址
        System.out.println(f3 == f4);//equals比较的内容
        System.out.println(f1.equals(f2));//== 比较的引用地址
        System.out.println(f3.equals(f4));//equals比较的内容

        Student student = new Student();
        student.setName("张无忌");
        changeName(student);
        System.out.println(student);

        StringBuffer name = new StringBuffer( "迪丽热巴");
        changeName1(name);
        System.out.println(name);
        String s = "xxxxxxxxxxx#123#456#zzzz";
        int n = s.indexOf("#");
        int k = s.indexOf("#",n+1);
        System.out.println(s.substring(n+1,k));

    }

    public static void changeName1(StringBuffer n1){
        n1.append( "古力娜扎" );
    }
    public static void changeName(Student s1){
        s1.setName("赵敏");
    }
}
